﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package net.wooga.pets.controllers {
    import net.wooga.pets.loading.vos.*;
    import net.wooga.pets.events.*;
    import net.wooga.pets.constants.*;
    import org.robotlegs.mvcs.*;
    import net.wooga.pets.models.world.*;

    public class CollectSpecialCommand extends Command {

        public var worldModel:WorldModel;

        override public function execute():void{
            var _local1:Object = {onError:this.onError, onResult:this.onResult};
            var _local2:RequestEvent = new RequestEvent(EventConstants.SEND_REQUEST, this.onResult);
            _local2.addRequest("collect_special", _local1);
            dispatch(_local2);
        }
        private function onResult(_arg1:ResultVO):void{
            var _local2:String;
            if (_arg1.success){
                _local2 = this.worldModel.getRoomIdsOfType(GameConstants.TYPE_WAITING_ROOM)[0];
                dispatch(new InfoEvent(EventConstants.CREATE_REWARD_ICONS, _local2, (_arg1.data.collect_special as Array)));
            };
        }
        private function onError(_arg1:String, _arg2:ResultVO):void{
            l("i collect only once a day");
        }

    }
}//package net.wooga.pets.controllers 
